<extend name="Public:base" />
<block name="content">
    <script type="text/javascript" src="Common/js/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        li{
            list-style: none;;
        }
    </style>
    <table class="table table-striped table-bordered table-hover search-form">
        <thead>
        <th>时间：<input id="startDate" name="start_time" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00',minDate:'%y-%M-{%d'})"/></label> - <input id="endDate" name="end_time" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00',minDate:'%y-%M-{%d}'})"/></th>
        <th>姓名：<input name="name" type="text" placeholder="" value="{:I('name')}" style="width:120px;" /></th>
        <th>手机号：<input name="phone" type="text" placeholder="" value="{:I('phone')}" /></th>
        <th>
            <a class="btn btn-primary" href="javascript:;" id="search" url="{:U('Category/searchone')}">查询</a>
        </th>
        <th>订单总数： 单 总金额： 元</th>
        </thead>
    </table>

    <div class="row">
        <div class="col-xs-12">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>头像</th>
                        <th>账号</th>
                        <th>姓名</th>
                        <th>地址</th>
                        <th>注册时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="data" id="vo">
                        <tr>
                            <td><img src="{$vo['user_face']}"></td>
                            <td><li>昵称：{$vo.user_name}</li><li>手机：{$vo.phone}</li></td>
                            <td style="width:250px;"><li>注册时间：{$vo.add_time}</li><li>最后一次登录时间：{$vo.last_login_time}</li><li>最近一次登录时间：{$vo.last_login_time}</li></td>
                            <td><a href="{:U('User/coupon')}/id/{$vo.user_id}">查看优惠券</a></td>
                            <php>if($vo['set_time']!=null && $vo['repair_order']!=null){</php>
                            <td>最后一次订单：{$vo.set_time} - {$vo.repair_order}<li><a>查看全部订单</a></li></td>
                            <php>}else{</php>
                            <td><li>暂无订单</li></td>
                            <php>}</php>
                            <td>
                                <php>if($vo['status']=='0'){</php>
                                <a href="{:U('User/black')}/id/{$vo.user_id}"class="btn btn-xs btn-danger" onclick="if(confirm('确定这样做吗？')==false){return false}"><i class="ace-icon fa">黑名单</i></a>
                                <a href="{:U('User/lock')}/id/{$vo.user_id}" class="btn btn-xs btn-info" onclick="if(confirm('确定这样做吗？')==false){return false}" style="margin-right: 10px;float:none;">
                                    <i class="ace-icon fa">锁定</i>
                                </a>
                                <php>}</php>
                                <php>if($vo['status']=='1'){</php>
                                <a href="{:U('User/black')}/id/{$vo.user_id}"class="btn btn-xs btn-danger" onclick="if(confirm('确定这样做吗？')==false){return false}"><i class="ace-icon fa">黑名单</i></a>
                                <a href="{:U('User/recover')}/id/{$vo.user_id}" class="btn btn-xs btn-info" onclick="if(confirm('确定这样做吗？')==false){return false}" style="margin-right: 10px;float:none;">
                                    <i class="ace-icon fa">恢复</i>
                                </a>
                                <php>}</php>
                                <php>if($vo['status']=='2'){</php>
                                <a href="{:U('User/recover')}/id/{$vo.user_id}" class="btn btn-xs btn-info" onclick="if(confirm('确定这样做吗？')==false){return false}" style="margin-right: 10px;float:none;">
                                    <i class="ace-icon fa">恢复</i>
                                </a>
                                <php>}</php>
                            </td>
                        </tr>
                    </volist>
                    <tr>
                        <td colspan="20" class="page">{$page}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</block>
<block name="javascript">
    <script>
        $(function(){

            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input,select').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });


        });
    </script>

</block>